#include "mainwindow.h"
#include "databasemanager.h"
#include <QApplication>
#include <QFile>
#include <logindialog.h>
int main(int argc, char *argv[])
{

    QApplication a(argc, argv);
    DataBaseManager::instance();
    QFile styleFile(":/style/style.qss");
    if (styleFile.open(QFile::ReadOnly)) {
        QString styleSheet = QString(styleFile.readAll());
        a.setStyleSheet(styleSheet);
        styleFile.close();
    }else {
        qWarning() << "Failed to load styleSheet:" << styleFile.errorString();
    }

    LoginDialog loginDlg;
    if(loginDlg.exec() == QDialog::Accepted){
        MainWindow w;
        w.show();
        return a.exec();
    }
    return 0;

}
